import Vue from 'vue'
import Router from 'vue-router'
//非懒加载写法
// import mainMenu from '@/components/mainMenu'

Vue.use(Router);
const router = new Router({
  //mode:'history',
  routes: [{
      path: '/',
      name: 'Login',
      // meta: {
      //     keepAlive: true,
      // },
      component: () =>
        import('@/components/Login')
    },
    {
      path: '/mainMenu',
      name: 'mainMenu',
      meta: {
        keepAlive: true
      },
      redirect: {
        name: 'showData'
      },
      component: () =>
        import('@/components/mainMenu'),
      children: [
        // {
        //                 path: 'home',
        //                 name: 'home',
        // 	component: () =>
        //                     import ('@/components/home')

        //             },
        {
          path: 'showData',
          name: 'showData',
          // redirect: {
          //     name: 'mainData'
          // },
          meta: {
            title: '监控中心',
            order: '2'
          },
          component: () =>
            import('@/components/showData')

        },

        {
          path: 'showScreenMap',
          name: 'showScreenMap',
          redirect: {
            name: 'largeScreenMap'
          },
          meta: {
            title: '地图大屏',
            order: '20-3'
          },
          component: () =>
            import('@/components/showScreenMap')

        },

        {
          path: 'mould',
          name: 'mould',
          meta: {
            title: '模板管理',
            order: '12'
          },
          component: () =>
            import('@/components/mould')

        },
        {
          path: 'addMould',
          name: 'addMould',
          meta: {
            title: '添加模板',
            order: '12'
          },
          component: () =>
            import('@/components/addMould')

        },
        {
          path: 'editMould',
          name: 'editMould',
          meta: {
            title: '编辑模板',
            order: '12'
          },
          component: () =>
            import('@/components/editMould')

        },

        {
          path: 'productList',
          name: 'productList',
          meta: {
            title: '项目管理',
            order: '5'
          },
          component: () =>
            import('@/components/productList')

        },
        {
          path: 'addProduct',
          name: 'addProduct',
          meta: {
            title: '添加项目',
            order: '5'
          },
          component: () =>
            import('@/components/addProduct')

        },
        {
          path: 'editProduct',
          name: 'editProduct',
          meta: {
            title: '编辑项目',
            order: '5'
          },
          component: () =>
            import('@/components/editProduct')

        },

        {
          path: 'device',
          name: 'device',
          meta: {
            title: '网关设备',
            order: '7-1'
          },
          component: () =>
            import('@/components/device')

        },
        {
          path: 'addDevice',
          name: 'addDevice',
          meta: {
            title: '添加网关设备',
            order: '7-1'
          },
          component: () =>
            import('@/components/addDevice')

        },
        {
          path: 'editDevice',
          name: 'editDevice',
          meta: {
            title: '编辑网关设备',
            order: '7-1'
          },
          component: () =>
            import('@/components/editDevice')

        },
        {
          path: 'virtualDevice',
          name: 'virtualDevice',
          meta: {
            title: '虚拟设备',
            order: '7-3'
          },
          component: () =>
            import('@/components/virtualDevice')

        },
        {
          path: 'addVirtualDevice',
          name: 'addVirtualDevice',
          meta: {
            title: '添加虚拟设备',
            order: '7-3'
          },
          component: () =>
            import('@/components/addVirtualDevice')

        },
        {
          path: 'editVirtualDevice',
          name: 'editVirtualDevice',
          meta: {
            title: '编辑虚拟设备',
            order: '7-3'
          },
          component: () =>
            import('@/components/editVirtualDevice')

        },
        {
          path: 'setVirtualDevice',
          name: 'setVirtualDevice',
          meta: {
            title: '配置虚拟设备',
            order: '7-3'
          },
          component: () =>
            import('@/components/setVirtualDevice')

        },
        {
          path: 'camera',
          name: 'camera',
          meta: {
            title: '摄像头管理',
            order: '11'
          },
          component: () =>
            import('@/components/camera')

        },
        {
          path: 'addCamera',
          name: 'addCamera',
          meta: {
            title: '添加摄像头',
            order: '11'
          },
          component: () =>
            import('@/components/addCamera')

        },
        {
          path: 'editCamera',
          name: 'editCamera',
          meta: {
            title: '编辑摄像头',
            order: '11'
          },
          component: () =>
            import('@/components/editCamera')

        },
        {
          path: 'knowledge',
          name: 'knowledge',
          meta: {
            title: '知识库管理',
            order: '15'
          },
          component: () =>
            import('@/components/knowledge')

        },
        {
          path: 'addArticle',
          name: 'addArticle',
          meta: {
            title: '添加文章',
            order: '15'
          },
          component: () =>
            import('@/components/addArticle')

        },
        {
          path: 'editArticle',
          name: 'editArticle',
          meta: {
            title: '编辑文章',
            order: '15'
          },
          component: () =>
            import('@/components/editArticle')

        },
        {
          path: 'transpondData',
          name: 'transpondData',
          meta: {
            title: '数据转发',
            order: '9'
          },
          component: () =>
            import('@/components/transpondData')

        },
        {
          path: 'addTranspond',
          name: 'addTranspond',
          meta: {
            title: '添加数据转发',
            order: '9'
          },
          component: () =>
            import('@/components/addTranspond')

        },
        {
          path: 'editTranspond',
          name: 'editTranspond',
          meta: {
            title: '编辑数据转发',
            order: '9'
          },
          component: () =>
            import('@/components/editTranspond')

        },

        {
          path: 'happen',
          name: 'happen',
          meta: {
            title: '触发器管理',
            order: '10'
          },
          component: () =>
            import('@/components/happen')

        },
        {
          path: 'addHappen',
          name: 'addHappen',
          meta: {
            title: '添加触发器',
            order: '10'
          },
          component: () =>
            import('@/components/addHappen')

        },
        {
          path: 'editHappen',
          name: 'editHappen',
          meta: {
            title: '编辑触发器',
            order: '10'
          },
          component: () =>
            import('@/components/editHappen')

        },
        {
          path: 'alarm',
          name: 'alarm',
          meta: {
            title: '报警信息',
            order: '4'
          },
          component: () =>
            import('@/components/alarm')

        },
        // {
        //     path: 'alarmTotal',
        //     name: 'alarmTotal',
        //     component:() =>
        //         import ('@/components/alarmTotal')

        // },
        {
          path: 'user',
          name: 'user',
          meta: {
            title: '用户管理',
            order: '13'
          },
          component: () =>
            import('@/components/user')

        },
        {
          path: 'addUser',
          name: 'addUser',
          meta: {
            title: '添加新用户',
            order: '13'
          },
          component: () =>
            import('@/components/addUser')


        },
        {
          path: 'editUser',
          name: 'editUser',
          meta: {
            title: '编辑用户',
            order: '13'
          },
          component: () =>
            import('@/components/editUser')

        },
        //            {
        //                path: 'userInfo',
        //                name: 'userInfo',
        // meta: {title: '用户信息',order:'10'},
        //                component: () =>
        //                    import ('@/components/userInfo')

        //            },
        {
          path: 'userlog',
          name: 'userlog',
          meta: {
            title: '日志记录',
            order: '13'
          },
          component: () =>
            import('@/components/userlog')

        },
        {
          path: 'viewList',
          name: 'viewList',
          meta: {
            title: '组态管理',
            order: '8'
          },
          component: () =>
            import('@/components/viewList')

        },
        {
          path: 'changeVar',
          name: 'changeVar',
          meta: {
            title: '组态变量替换',
            order: '8'
          },
          component: () =>
            import('@/components/changeVar')

        },

        {
          path: 'showView',
          name: 'showView',
          meta: {
            title: '组态监控',
            order: '8'
          },
          component: () =>
            import('@/components/showView')

        },
        {
          path: 'editStage',
          name: 'editStage',
          meta: {
            title: '编辑组态',
            order: '8'
          },
          component: () =>
            import('@/components/editStage')
        },
        {
          path: 'setSite',
          name: 'setSite',
          meta: {
            title: '系统设置',
            order: '14'
          },
          component: () =>
            import('@/components/setSite')
        }, ,
        {
          path: 'report',
          name: 'report',
          meta: {
            title: '报表管理',
            order: '19'
          },
          component: () =>
            import('@/components/report')

        },
        {
          path: 'addReport',
          name: 'addReport',
          meta: {
            title: '添加报表',
            order: '19'
          },
          component: () =>
            import('@/components/addReport')

        },
        {
          path: 'editReport',
          name: 'editReport',
          meta: {
            title: '编辑报表',
            order: '19'
          },
          component: () =>
            import('@/components/editReport')

        },

      ]
    },
    {
      path: '/profile',
      name: 'profile',
      meta: {
        title: '个人中心',
        order: '0'
      },
      component: () =>
        import('@/components/profile')

    },
    // {
    // 	path: '/largeScreen',
    // 	name: 'largeScreen',
    // 	meta: { title: '大屏展示', order: '20' },
    // 	component: () =>
    // 		import('@/components/largeScreen')
    // },
    {
      path: '/largeScreen',
      name: 'largeScreen',
      meta: {
        title: '大屏展示',
        order: '20-1'
      },

      component: () =>
        import('@/components/largeScreen')
    },
    {
      path: '/largeScreenNew',
      name: 'largeScreenNew',
      meta: {
        title: '能耗大屏',
        order: '20-2'
      },

      component: () =>
        import('@/components/largeScreenNew')
    },
    {
      path: '/largeScreenMap',
      name: 'largeScreenMap',
      meta: {
        title: '地图大屏',
        order: '20-3'
      },

      component: () =>
        import('@/components/largeScreenMap')
    },
    {
      path: '/largeScreenConfig',
      name: 'largeScreenConfig',
      meta: {
        title: '配置大屏',
        order: '20-4'
      },

      component: () =>
        import('@/components/largeScreenConfig')
    },
    {
      path: '/largeScreenConfigPreview',
      name: 'largeScreenConfigPreview',
      meta: {
        title: '预览大屏',
        order: '20-5'
      },

      component: () =>
        import('@/components/largeScreenConfigPreview')
    },
    
    
        // 大屏配置
    {
       path: '/configLarge',
        name: 'configLarge',
        component: () =>
            import ('@/components/configLarge')

      },
    {
      path: '/mainData',
      name: 'mainData',
      meta: {
        title: '监控中心',
        order: '2'
      },
      component: () =>
        import('@/components/mainData')

    },
    {
      path: '/mainView',
      name: 'mainView',
      meta: {
        title: '监控中心',
        order: '2'
      },
      component: () =>
        import('@/components/mainView')
      // meta: {
      //     requiresAuth: true,
      //     active: 'showData'
      // }
    },

    // {
    //      path: '/transparentTransmission', //不在菜单的children里面，就要加"/",表示根目录
    //      name: 'transparentTransmission',
    //      component: () =>
    //          import ('@/components/transparentTransmission')
    // },
    // {
    //     path: '/slave', //不在菜单的children里面，就要加"/",表示根目录
    //     name: 'slave',
    //  meta: {title: '配置网关设备',order:'7-1'},
    //     component: () =>
    //         import ('@/components/slave')
    // },
    {
      path: '/deviceSet', //不在菜单的children里面，就要加"/",表示根目录
      name: 'deviceSet',
      meta: {
        title: '配置网关',
        order: '7-1'
      },
      component: () =>
        import('@/components/deviceSet')
    },

    {
      path: '/slaveRead',
      name: 'slaveRead',
      component: () =>
        import('@/components/slaveRead')
    }
  ]
})
export default router;
